With the 'destroyed' attribute you can set a script file that is called when the block is destroyed by a player. You can use world and origin for your script.
destroyed="loader.loadScript('xyz.script');";